package com.ruoyi.point.service.impl;

import java.util.List;

import com.ruoyi.point.mapper.SessionPermissionsMapper;
import com.ruoyi.point.pojo.SessionPermissions;
import com.ruoyi.point.service.ISessionPermissionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 记录权杖人员Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-25
 */
@Service
public class SessionPermissionsServiceImpl implements ISessionPermissionsService
{
    @Autowired
    private SessionPermissionsMapper sessionPermissionsMapper;

    /**
     * 查询记录权杖人员
     *
     * @param userId 记录权杖人员主键
     * @return 记录权杖人员
     */
    @Override
    public SessionPermissions selectSessionPermissionsById(Long id)
    {
        return sessionPermissionsMapper.selectSessionPermissionsById(id);
    }

    @Override
    public int selectSessionPermissionsByHasPowerInfo(Long hasPowerInfo) {
        return sessionPermissionsMapper.selectSessionPermissionsByHasPowerInfo(hasPowerInfo);
    }

    /**
     * 查询记录权杖人员列表
     *
     * @param sessionPermissions 记录权杖人员
     * @return 记录权杖人员
     */
    @Override
    public List<SessionPermissions> selectSessionPermissionsList(SessionPermissions sessionPermissions)
    {
        return sessionPermissionsMapper.selectSessionPermissionsList(sessionPermissions);
    }

    /**
     * 新增记录权杖人员
     *
     * @param sessionPermissions 记录权杖人员
     * @return 结果
     */
    @Override
    public int insertSessionPermissions(SessionPermissions sessionPermissions)
    {
        return sessionPermissionsMapper.insertSessionPermissions(sessionPermissions);
    }

    /**
     * 修改记录权杖人员
     *
     * @param sessionPermissions 记录权杖人员
     * @return 结果
     */
    @Override
    public int updateSessionPermissions(SessionPermissions sessionPermissions)
    {
        return sessionPermissionsMapper.updateSessionPermissions(sessionPermissions);
    }

    @Override
    public int updateSessionPermissionsByHasPowerInfo(Long hasPowerInfo) {
        return sessionPermissionsMapper.updateSessionPermissionsByHasPowerInfo(hasPowerInfo);
    }

    /**
     * 批量删除记录权杖人员
     *
     * @param userIds 需要删除的记录权杖人员主键
     * @return 结果
     */
    @Override
    public int deleteSessionPermissionsByUserIds(Long[] userIds)
    {
        return sessionPermissionsMapper.deleteSessionPermissionsByUserIds(userIds);
    }

    /**
     * 删除记录权杖人员信息
     *
     * @param userId 记录权杖人员主键
     * @return 结果
     */
    @Override
    public int deleteSessionPermissionsByUserId(Long userId)
    {
        return sessionPermissionsMapper.deleteSessionPermissionsByUserId(userId);
    }
}
